package com.lwl.leetcode;

/**
 * @author lwl
 * @Description TODO
 * @date 2023/7/26 0:42
 */
public class Code09IsPalindrome {

    public boolean isPalindrome(int x) {
        char[] str = String.valueOf(x).toCharArray();
        int left = 0;
        int right = str.length - 1;
        while (left <= right) {
            if (str[left++] != str[right--]) {
                return false;
            }
        }
        return true;
    }

}
